<%@page import="RssEasy.DAL.Pagination"%>
<%@page import="Model.Purchase.PurchaseListView"%>
<%@page import="Model.Purchase.PurchaseMaterielListView"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    PurchaseListView pur = new PurchaseListView(pageContext);
    PurchaseListView num = new PurchaseListView(pageContext);
    String k = request.getParameter("keywords");
    pur.select("id,name,enddt,shijian,state,shengid,shiid,xianid,typid,corpname,myid,fulladress").where("typid=2 and state=1 and name like '%"+k+"%'").get_page_desc("id");
    num.select("count(*) as num").where("typid=2 and state=1 and name like '%"+k+"%'").get_first_rows();
    String color = "";
    String href ="";
    String name ="";
    String click ="";
    int numb =(int)Math.ceil(Integer.parseInt(num.get("num"))/10.0);
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>企企通-搜索结果</title>
        <meta name="description" content="这里写网站内容描述" />
        <meta name="keywords" content="这里写关键词" />
        <meta name="Robots" contect="all">
        <link href="/css/reset.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/head.css" rel="stylesheet" type="text/css"/>
        <link href="/inc/footer.css" rel="stylesheet" type="text/css"/>
        <link href="/css/search_resuls.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <%@include file="/inc/head.jsp" %>
        <p>当前位置：<span>寻源搜索列表</span></p>
        <div id="main">
            <form action="/search_xiangqing" method="post" id="form">
                <p today="">
                    发布时间：
                    <label><span class="selected">不限</span><input type="radio" name="shijian" checked="checked" value="0"/></label>
                    <label><span>今天</span><input type="radio" name="shijian"   value="1"/></label>
                    <label><span>近三天</span><input type="radio" name="shijian" value="3"/></label>
                    <label><span>近一周</span><input type="radio" name="shijian" value="7"/></label>
                    <label><span>一个月</span><input type="radio" name="shijian" value="30"/></label>
                    <label><span>近一年</span><input type="radio" name="shijian" value="365"/></label>                                                  
                </p>
                <p message="">
                    信息类型：
                    <label><span class="selected" zhuangtai="" val="0">项目公告</span><input type="radio" name="gonggao" value="0" checked="checked"/></label>
                    <label><span class="" val="1">项目结果公告</span><input type="radio" name="gonggao" value="1"/></label>
                </p>
                <div id="proviso">
                    筛选条件：
<!--                    <select id="province" name="shengid" value="">
                        <option value="">省</option>
                    </select>
                    <select id="city" name="shiid" value="">
                        <option value="">市</option>
                    </select>
                    <select id="district" name="xianid" value="">
                        <option value="">县/区</option>
                    </select>-->
                    <input id="sousuo" type="text" name="materielname" placeholder="请输入关键词" value="<%=k%>"/>
                    <button type="button" id="sh">查询</button>
                </div>
            </form>
            <h2>结果列表<span id="num">共有<%num.write("num");%>条</span></h2>
            <div id="list">
                <ul>
                    <%
                      while (pur.for_in_rows()) {
                                  name = "寻源";
                                  color = "#009688";
                                  href = "/source/details/";
                                  click = "快捷报名";
                                  String shijian = pur.get("enddt");
                                  if(shijian.equals("2769091200")){
                                  shijian ="长期有效";
                                  pur.keyvalue("enddt","");
                                  }else{
                                  shijian ="";
                                  }
                    %>
                    <li>
                        <div class="notice" state="" style="background-color:<%=color%>"><%=name%></div><a class='name' href="<%=href%><%pur.write("id");%>" target="blank"><%pur.write("corpname");%></a>
                        <h2>发布企业：<a class="company" href='/supplier/home/<%pur.write("myid");%>' target="blank"><%pur.write("name");%></a></h2>
                        <h3>所在地：<span class="addr"><%pur.write("fulladress");%></span></h3><h4>截止日期：<span rssdate="<%pur.write("enddt");%>,yyyy-MM-dd"><%=shijian%></span></h4>
                        <h5>发布日期：<span rssdate="<%pur.write("shijian");%>,yyyy-MM-dd"></span></h5><a class='price' href="<%=href%><%pur.write("id");%>" target="blank"><%=click%></a>
                    </li>
                    <%
                      }
                    %>
                </ul>
            <div id='page_navigation' class="w1000">
            <a href= "javascript:void(0);" id="first" onclick ="first()" sort="">首页</a>
            <a href= "javascript:void(0);" id="previous" onclick ="previous()" sort="">上一页</a>
            <a><b>1</b>/<b><%=numb%></b></a>
            <a href= "javascript:void(0);" id="next" onclick ="next()" sort="">下一页</a>
            <a href= "javascript:void(0);" id="last" onclick ="last()" sort="">尾页</a>
            <a>跳转</a>
            <input type="text" name="jump" value=""/>
            <a href= "javascript:void(0);" id="jump" onclick ="jump()" sort="">确定</a>
                </div>
            </div>
            <div id="empty">
                <h1>抱歉，没有符合条件的结果信息~</h1>
                <h2>您还可以尝试以下方法：</h2>
                <ul>
                    <li>查看搜索的条件是否选择正确；</li>
                    <li>试试其他同义字词；</li>
                    <li>可以致电您的客服经理寻求帮助；</li>
                </ul>
            </div>
        </div>
        <%@include file="/inc/footer.jsp"%>
        <%@include file="/inc/js_all.html"%>
        <script src="/js/arealist.js" type="text/javascript"></script>
        <script src="/data/dictdata.js" type="text/javascript"></script>
        <script type="text/javascript" src="/data/arealist.js"></script>
        <script src="/js/source_list.js" type="text/javascript"></script>
    </body>
</html>
